package com.asd.system.mapper;

import com.asd.system.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author
 * @createtime 2021-09-13 14:19
 * @description
 */
@Mapper
@Component
public interface UserMapper extends BaseMapper<User> {

    void updateByUserName(String userName);

    @Select("select * from user where userName = #{username}")
    User findToName(@Param("username") String username);


    @Select("select * from user where orgId = #{orgId}")
    List<User> getByOrgId(@Param("orgId")String orgId);

    @Update("update user set nickname=#{nickname} ,note=#{note} where id=#{id}")
    void updateUserBasicInfo(@Param("id")String id, @Param("nickname")String nickname, @Param("note")String note);
}
